// 1827. 最少操作使数组递增
/**
 * @param {number[]} nums
 * @return {number}
 */

var minOperations = function (nums) {
	let pre = nums[0] - 1,
		res = 0
	for (const num of nums) {
		pre = Math.max(pre + 1, num)
		res += pre - num
	}
	return res
}
const ret = minOperations([1, 1, 1])
console.log('minOperations :>>', ret)
